package com.itheima.reggie.common;

/**
 * 获取session中id值的工具类
 */

public class BaseContext {
    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    /**
     * 存入id值
     *
     * @param id
     */
    public static void setId(long id) {
        threadLocal.set(id);
    }

    /**
     * 获取id方法
     *
     * @return
     */
    public static Long getId() {
        return threadLocal.get();
    }
}
